//2009/08/10 20:18:53
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class GolfScore
{
public:
    int tally(vector <int> par, vector <string> sc)
    {
		samp["triple bogey"] = 3;
		samp["double bogey"] = 2;
		samp["bogey"] = 1;
		samp["par"] = 0;
		samp["birdie"] = -1;
		samp["eagle"] = -2;
		samp["albatross"] = -3;
		samp["hole in one"] = 1;
		int score = 0;
		for(int i=0; i<par.size(); i++)
		{
			score += par[i] + samp[sc[i]];
			if(sc[i].compare("hole in one") == 0) score -= par[i];
		}
		return score;
    }
private:
	map<string, int> samp;
};
/*
//2009/08/10 20:18:53
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class GolfScore
{
public:
    int tally(vector <int> par, vector <string> sc)
    {
		int score = 0;
		for(int i=0; i<par.size(); i++)
		{
			int inc = par[i];
			if(sc[i].compare("triple bogey")==0) inc += 3;
			else if(sc[i].compare("double bogey")==0) inc += 2;
			else if(sc[i].compare("bogey")==0) inc += 1;
			else if(sc[i].compare("birdie")==0) inc -= 1;
			else if(sc[i].compare("eagle")==0) inc -= 2;
			else if(sc[i].compare("albatross")==0) inc -= 3;
			else if(sc[i].compare("hole in one")==0) inc = 1;
			score += inc;
		}
		return score;
    }
private:
	map<string, int> samp;
};
*/
